package com.vhall.component.entity.goods.goods;

import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author guoxin.wang
 * @date 2021/10/25
 */
@Data
public class LiveGoodsStatsConsoleReqVO implements Serializable {

    private static final long serialVersionUID = -5084107562724346812L;

    /**
     * 房间id
     */
    @NotBlank(message = "room_id参数不允许为空！")
    @ParamName("room_id")
    private String roomId;

    @ParamName("start_time")
    private String beginTime;

    @ParamName("end_time")
    private String endTime;

    /**
     * 页码
     */
    @ParamName("page")
    @Min(value = 1, message = "page参数不允许小于1！")
    private Integer page = 1;

    @ParamName("page_size")
    @Min(value = 1, message = "page_size参数不允许小于1！")
    private Integer pageSize = 10;

    public void setDefault() {
        if (Objects.isNull(page)) {
            page = 1;
        }
        if (Objects.isNull(pageSize)) {
            pageSize = 10;
        }
    }

}
